<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>childNodes</title>
    <link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.2.0/css/bootstrap.min.css">
    <script>
        window.onload = function(){
            var oUl = document.getElementById('ul1');
            var child = oUl.childNodes.length;
//            alert(child);
            function square(num){
                total = num * num;
                return total;
            }

            var total = 111;
            var number = square(20);
            alert(total);
        }
    </script>
</head>
<body>
    <ul id="ul1">
        <li id="li">1111111</li><li>2222222</li>
        <li>3333333</li>
        <li>4444444</li>
    </ul>
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<script src="http://cdn.bootcss.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>